package com.lianzhihui.romeex.mvp.presenter;

import android.content.Context;

import com.lianzhihui.romeex.bean.PledgeRecordsBean;
import com.lianzhihui.romeex.mvp.model.ExtractRecordInterface;
import com.lianzhihui.romeex.mvp.model.ExtractRecordModelImp;
import com.lianzhihui.romeex.mvp.view.ExtractRecrodView;

import java.util.List;

/**
 * Description:
 * Author: RAMON
 * CreateDate: 11/30/20 10:06 PM
 * UpdateUser:
 * UpdateDate:
 * UpdateRemark:
 * Version:
 */
public class ExtractRecrodPresenter implements ExtractRecordInterface {

    Context context;
    ExtractRecrodView iView;
    ExtractRecordModelImp iModel;

    public ExtractRecrodPresenter(Context context, ExtractRecrodView iView) {
        this.context = context;
        this.iView = iView;
        iModel = new ExtractRecordModelImp(context, this);
    }

    public void getExtranct(int pageNum, String status) {
        iModel.getExtractRecord(pageNum, status);
    }

    @Override
    public void onExtractRecordSuccess(List<PledgeRecordsBean.PledgeRecordBean> content) {
        iView.onExtractRecordSuccess(content);
    }

    @Override
    public void onExtractRecordFail(String message) {
        iView.onExtractRecordFail(message);
    }

    @Override
    public void onFailure() {

    }
}
